home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / amiga / hdf / hdf.lha / DFF.C < prev    next >
Encoding:
C/C++ Source or Header  |  1980-02-06  |  18.6 KB  |  636 lines

  1. /***************************************************************************
  2. *
  3. *
  4. *                         NCSA HDF version 3.2r2
  5. *                            October 30, 1992
  6. *
  7. * NCSA HDF Version 3.2 source code and documentation are in the public
  8. * domain.  Specifically, we give to the public domain all rights for future
  9. * licensing of the source code, all resale rights, and all publishing rights.
  10. *
  11. * We ask, but do not require, that the following message be included in all
  12. * derived works:
  13. *
  14. * Portions developed at the National Center for Supercomputing Applications at
  15. * the University of Illinois at Urbana-Champaign, in collaboration with the
  16. * Information Technology Institute of Singapore.
  17. *
  18. * THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE
  19. * SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION,
  20. * WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE
  21. *
  22. ****************************************************************************
  23. */
  24.  
  25. #ifdef RCSID
  26. static char RcsId[] = "@(#)$Revision: 1.2 $";
  27. #endif
  28. /*
  29. $Header: /hdf/hdf/v3.2r2/src/RCS/dff.c,v 1.2 1992/09/11 14:15:04 koziol beta koziol $
  30.  
  31. $Log: dff.c,v $
  32.  * Revision 1.2  1992/09/11  14:15:04  koziol
  33.  * Changed Fortran stubs' parameter passing to use a new typedef, intf,
  34.  * which should be typed to the size of an INTEGER*4 in whatever Fortran
  35.  * compiler the C functions need to be compatible with.  (This is mostly
  36.  * for the PC and possibly for the Mac)
  37.  *
  38.  * Revision 1.1  1992/08/25  21:40:44  koziol
  39.  * Initial revision
  40.  *
  41. */
  42. /*-----------------------------------------------------------------------------
  43.  * File:    dfF.c
  44.  * Purpose: C stubs for Fortran low level routines
  45.  * Invokes: dfF.c
  46.  * Contents: 
  47.  *  dfiopen:   call DFopen to open HDF file
  48.  *  dfclose:   call DFclose to close HDF file
  49.  *  dfdesc:    call DFdescriptors to get contents of DDs
  50.  *  dfdup:     call DFdup to create additional DD for item
  51.  *  dfdel:     call DFdel to delete DD of item
  52.  *  dfiaccess: call DFaccess to set up access to item
  53.  *  dfstart:   call DFaccess to set up access to item
  54.  *  dfread:    call DFread to read part of item
  55.  *  dfseek:    call DFseek to move to offset within item
  56.  *  dfwrite:   call DFwrite to write part of item
  57.  *  dfupdate:  call DFupdate to write out changes
  58.  *  dfget:     call DFgetelement to read item
  59.  *  dfput:     call DFputelement to write item
  60.  *  dfsfind:   call DFsetfind to set up search
  61.  *  dffind:    call DFfind to find next matching item
  62.  *  dferrno:   call DFerrno to return value of DFerror
  63.  *  dfnewref:  call DFnewref to get unused ref no
  64.  *  dfnumber:  call DFnumber to get number of occurrances of given tag
  65.  *  dfstat:    call DFstat to get status info on file
  66.  *  dfiishdf:  call DFishdf to get HDF string
  67.  *---------------------------------------------------------------------------*/
  68.  
  69. #include "df.h"
  70.  
  71. #ifndef DF_FNAMES
  72. #   define DF_FNAMES
  73. #ifdef DF_CAPFNAMES
  74. #   define ndfiaccess   FNAME(DFIACCESS)
  75. #   define ndfiopen  FNAME(DFIOPEN)
  76. #   define ndfclose  FNAME(DFCLOSE)
  77. #   define ndfdesc   FNAME(DFDESC)
  78. #   define ndfdup    FNAME(DFDUP)
  79. #   define ndfdel    FNAME(DFDEL)
  80. #   define ndfstart  FNAME(DFSTART)
  81. #   define ndfread   FNAME(DFREAD)
  82. #   define ndfseek   FNAME(DFSEEK)
  83. #   define ndfwrite  FNAME(DFWRITE)
  84. #   define ndfupdate FNAME(DFUPDATE)
  85. #   define ndfget    FNAME(DFGET)
  86. #   define ndfput    FNAME(DFPUT)
  87. #   define ndfsfind  FNAME(DFSFIND)
  88. #   define ndffind   FNAME(DFFIND)
  89. #   define ndferrno  FNAME(DFERRNO)
  90. #   define ndfnewref FNAME(DFNEWREF)
  91. #   define ndfnumber FNAME(DFNUMBER)
  92. #   define ndfstat   FNAME(DFSTAT)
  93. #   define ndfiishdf FNAME(DFIISHDF)
  94. #else   /* !DF_CAPFNAMES */
  95. #   define ndfiaccess   FNAME(dfiaccess)
  96. #   define ndfiopen  FNAME(dfiopen)
  97. #   define ndfclose  FNAME(dfclose)
  98. #   define ndfdesc   FNAME(dfdesc)
  99. #   define ndfdup    FNAME(dfdup)
  100. #   define ndfdel    FNAME(dfdel)
  101. #   define ndfstart  FNAME(dfstart)
  102. #   define ndfread   FNAME(dfread)
  103. #   define ndfseek   FNAME(dfseek)
  104. #   define ndfwrite  FNAME(dfwrite)
  105. #   define ndfupdate FNAME(dfupdate)
  106. #   define ndfget    FNAME(dfget)
  107. #   define ndfput    FNAME(dfput)
  108. #   define ndfsfind  FNAME(dfsfind)
  109. #   define ndffind   FNAME(dffind)
  110. #   define ndferrno  FNAME(dferrno)
  111. #   define ndfnewref FNAME(dfnewref)
  112. #   define ndfnumber FNAME(dfnumber)
  113. #   define ndfstat   FNAME(dfstat)
  114. #   define ndfiishdf FNAME(dfiishdf)
  115. #endif /* DF_CAPFNAMES */
  116. #endif /* DF_FNAMES */
  117.  
  118. /*-----------------------------------------------------------------------------
  119.  * Name:    dfiopen
  120.  * Purpose: call DFopen to open HDF file
  121.  * Inputs:  name: name of file to open
  122.  *      access: access mode - integer with value DFACC_READ etc. 
  123.  *      defdds: default number of DDs per header block
  124.  *      namelen: length of name
  125.  * Returns: 0 on success, -1 on failure with DFerror set
  126.  * Users:   HDF Fortran programmers
  127.  * Invokes: DFopen
  128.  * Method:  Convert filename to C string, call DFopen
  129.  *---------------------------------------------------------------------------*/
  130.  
  131.     FRETVAL(intf)
  132. #ifdef PROTOTYPE
  133. ndfiopen(_fcd name, intf *access, intf *defdds, intf *namelen)
  134. #else
  135. ndfiopen(name, access, defdds, namelen)
  136.     _fcd name;
  137.     intf *access, *defdds;
  138.     intf *namelen;
  139. #endif /* PROTOTYPE */
  140. {
  141.     char *fn;
  142.     intf ret;
  143.     
  144.     fn = DFIf2cstring(name, *namelen);
  145.     ret = (int32) DFopen(fn, (intn)*access, (intn)*defdds);
  146.     HDfreespace(fn);
  147.     return(ret);
  148. }
  149.  
  150.  
  151. /*-----------------------------------------------------------------------------
  152.  * Name:    dfclose
  153.  * Purpose: Call DFclose to close HDF file
  154.  * Inputs:  dfile: pointer to HDF file to close
  155.  * Returns: 0 on success, -1 on failure with DFerror set
  156.  * Users:   HDF Fortran programmers
  157.  * Invokes: DFclose
  158.  *---------------------------------------------------------------------------*/
  159.  
  160.     FRETVAL(intf)
  161. #ifdef PROTOTYPE
  162. ndfclose(intf *dfile)
  163. #else
  164. ndfclose(dfile)
  165.     intf *dfile;
  166. #endif /* PROTOTYPE */
  167. {
  168.     return(DFclose((DF *)*dfile));
  169. }
  170.  
  171.  
  172. /*-----------------------------------------------------------------------------
  173.  * Name:    dfdesc
  174.  * Purpose: Call DFdescriptors to obtain descriptors
  175.  * Inputs:  dfile: pointer to HDF file
  176.  *          ptr: pointer to array of size >= (4, num) to put descriptors in
  177.  * Returns: 0 on success, -1 on failure with DFerror set
  178.  * Users:   HDF Fortran programmers
  179.  * Invokes: DFdesc
  180.  *---------------------------------------------------------------------------*/
  181.  
  182.     FRETVAL(intf)
  183. #ifdef PROTOTYPE
  184. ndfdesc(intf *dfile, intf ptr[][4], intf *begin, intf *num)
  185. #else
  186. ndfdesc(dfile, ptr, begin, num)
  187.     intf *dfile, *begin, *num;
  188.     intf ptr[][4];
  189. #endif /* PROTOTYPE */
  190. {
  191.     DFdesc *ptr1;
  192.     int i;
  193.     intf num_desc;
  194.  
  195.             /* allocate temporary space */
  196.     ptr1 = (DFdesc *) HDgetspace((uint32)*num * sizeof(DFdesc));
  197.     num_desc = DFdescriptors((DF*)*dfile, ptr1, (intn)*begin, (intn)*num);
  198.     
  199.     /* copy ptr1 array  ptr; note row/column inversion */
  200.     for (i=0; i<num_desc; i++)
  201.     {
  202.         ptr[i][0] = (int32)ptr1[i].tag;
  203.         ptr[i][1] = (int32)ptr1[i].ref;
  204.         ptr[i][2] = ptr1[i].offset;
  205.         ptr[i][3] = ptr1[i].length;
  206.     }
  207.  
  208.     HDfreespace(ptr1);
  209.  
  210.     return(num_desc);
  211. }
  212.  
  213.  
  214. /*-----------------------------------------------------------------------------
  215.  * Name:    dfdup
  216.  * Purpose: Call DFdup to create additional DD for item
  217.  * Inputs:  dfile: pointer to HDF file
  218.  *          tag, ref: attributes of new DD to add
  219.  *          otag, oref: attributes of item to point to
  220.  * Returns: 0 on success, -1 on failure with DFerror set
  221.  * Users:   HDF Fortran programmers
  222.  * Invokes: DFdup
  223.  *---------------------------------------------------------------------------*/
  224.  
  225.     FRETVAL(intf)
  226. #ifdef PROTOTYPE
  227. ndfdup(intf *dfile, intf *tag, intf *ref, intf *otag, intf *oref)
  228. #else
  229. ndfdup(dfile, tag, ref, otag, oref)
  230.     intf *dfile;
  231.     intf *tag, *ref, *oref, *otag;
  232. #endif /* PROTOTYPE */
  233. {
  234.     return(DFdup((DF *)*dfile, (uint16)*tag, (uint16)*ref, (uint16)*otag,
  235.            (uint16)*oref));
  236. }
  237.  
  238.  
  239. /*-----------------------------------------------------------------------------
  240.  * Name:    dfdel
  241.  * Purpose: Call DFdel to delete DD of item
  242.  * Inputs:  dfile: pointer to HDF file
  243.  *          tag, ref: attributes of DD to delete
  244.  * Returns: 0 on success, -1 on failure with DFerror set
  245.  * Users:   HDF Fortran programmers
  246.  * Invokes: DFdel
  247.  *---------------------------------------------------------------------------*/
  248.  
  249.     FRETVAL(intf)
  250. #ifdef PROTOTYPE
  251. ndfdel(intf *dfile, intf *tag, intf *ref)
  252. #else
  253. ndfdel(dfile, tag, ref)
  254.     intf *dfile;
  255.     intf *tag, *ref;
  256. #endif /* PROTOTYPE */
  257. {
  258.     return (DFdel((DF *)*dfile, (uint16)*tag, (uint16)*ref));
  259. }
  260.  
  261.  
  262. /*-----------------------------------------------------------------------------
  263.  * Name:    dfiaccess
  264.  * Purpose: Call DFaccess to set up access to item
  265.  * Inputs:  dfile: pointer to HDF file
  266.  *          tag, ref: attributes of item to access
  267.  *          access: access mode
  268.  * Returns: 0 on success, -1 on failure with DFerror set
  269.  * Users:   HDF Fortran programmers
  270.  * Invokes: DFaccess
  271.  *---------------------------------------------------------------------------*/
  272.  
  273.     FRETVAL(intf)
  274. #ifdef PROTOTYPE
  275. ndfiaccess(intf *dfile, intf *tag, intf *ref, _fcd access, intf *acclen)
  276. #else
  277. ndfiaccess(dfile, tag, ref, access, acclen)
  278.     intf *dfile;
  279.     intf *tag, *ref;
  280.     _fcd access;
  281.     intf *acclen;
  282. #endif /* PROTOTYPE */
  283. {
  284.     char *acc;
  285.     intf ret;
  286.  
  287.     acc = DFIf2cstring(access, *acclen);
  288.     ret = (int32)DFaccess((DF *) *dfile, (uint16)*tag, (uint16)*ref, acc);
  289.     HDfreespace(acc);
  290.     return(ret);
  291. }
  292.  
  293.  
  294. #if 0
  295. /*-----------------------------------------------------------------------------
  296.  * Name:    dfstart
  297.  * Purpose: Call DFaccess to set up access to item
  298.  * Inputs:  dfile: pointer to HDF file
  299.  *          tag, ref: attributes of item to access
  300.  *          access: access mode
  301.  * Returns: 0 on success, -1 on failure with DFerror set
  302.  * Users:   HDF Fortran programmers
  303.  * Invokes: DFaccess
  304.  *---------------------------------------------------------------------------*/
  305.  
  306.     FRETVAL(intf)
  307. #ifdef PROTOTYPE
  308. ndfstart(intf *dfile, intf *tag, intf *ref, char *access)
  309. #else
  310. ndfstart(dfile, tag, ref, access)
  311.     intf *dfile;
  312.     intf *tag, *ref;
  313.     char *access;
  314. #endif /* PROTOTYPE */
  315. {
  316.     return(DFaccess((DF *)*dfile, (uint16)*tag, (uint16)*ref, access));
  317. }
  318. #endif /* 0 */
  319.  
  320. /*-----------------------------------------------------------------------------
  321.  * Name:    dfread
  322.  * Purpose: Call DFread to read part of item
  323.  * Inputs:  dfile: pointer to HDF file
  324.  *          ptr: pointer to space to read item into
  325.  *          len: number of bytes to read
  326.  * Returns: 0 on success, -1 on failure with DFerror set
  327.  * Users:   HDF Fortran programmers
  328.  * Invokes: DFread
  329.  *---------------------------------------------------------------------------*/
  330.  
  331.     FRETVAL(intf)
  332. #ifdef PROTOTYPE
  333. ndfread(intf *dfile, _fcd ptr, intf *len)
  334. #else
  335. ndfread(dfile, ptr, len)
  336.     intf *dfile, *len;
  337.     _fcd ptr;
  338. #endif /* PROTOTYPE */
  339. {
  340.     return (DFread((DF *) *dfile, (char *)_fcdtocp(ptr), *len));
  341. }
  342.  
  343. /*-----------------------------------------------------------------------------
  344.  * Name:    dfseek
  345.  * Purpose: Call DFseek to move to offset within item
  346.  * Inputs:  dfile: pointer to HDF file
  347.  *        offset: number of bytes from beginning of item to move to
  348.  * Returns: 0 on success, -1 on failure with DFerror set
  349.  * Users:   HDF Fortran programmers
  350.  * Invokes: DFseek
  351.  *---------------------------------------------------------------------------*/
  352.  
  353.     FRETVAL(intf)
  354. #ifdef PROTOTYPE
  355. ndfseek(intf *dfile, intf *offset)
  356. #else
  357. ndfseek(dfile, offset)
  358.     intf *dfile, *offset;
  359. #endif /* PROTOTYPE */
  360. {
  361.     return (DFseek((DF *)*dfile, *offset));
  362. }
  363.  
  364.  
  365. /*-----------------------------------------------------------------------------
  366.  * Name:    dfwrite
  367.  * Purpose: Call DFwrite to write part of item
  368.  * Inputs:  dfile: pointer to HDF file
  369.  *        ptr: pointer to data to write
  370.  *        len: number of bytes to write
  371.  * Returns: 0 on success, -1 on failure with DFerror set
  372.  * Users:   HDF Fortran programmers
  373.  * Invokes: DFwrite
  374.  *---------------------------------------------------------------------------*/
  375.  
  376.     FRETVAL(intf)
  377. #ifdef PROTOTYPE
  378. ndfwrite(intf *dfile, _fcd ptr, intf *len)
  379. #else
  380. ndfwrite(dfile, ptr, len)
  381.     intf *dfile, *len;
  382.     _fcd ptr;
  383. #endif /* PROTOTYPE */
  384. {
  385.     return (DFwrite((DF *)*dfile, (char *)_fcdtocp(ptr), *len));
  386. }
  387.  
  388. /*-----------------------------------------------------------------------------
  389.  * Name:    dfupdate
  390.  * Purpose: Call DFupdate to write out changes
  391.  * Inputs:  dfile: pointer to HDF file
  392.  * Returns: 0 on success, -1 on failure with DFerror set
  393.  * Users:   HDF Fortran programmers
  394.  * Invokes: DFupdate
  395.  *---------------------------------------------------------------------------*/
  396.  
  397.     FRETVAL(intf)
  398. #ifdef PROTOTYPE
  399. ndfupdate(intf *dfile)
  400. #else
  401. ndfupdate(dfile)
  402.     intf *dfile;
  403. #endif /* PROTOTYPE */
  404. {
  405.     return (DFupdate((DF *)*dfile));
  406. }
  407.  
  408.  
  409. /*-----------------------------------------------------------------------------
  410.  * Name:    dfget
  411.  * Purpose: Call DFget to read an element
  412.  * Inputs:  dfile: pointer to HDF file
  413.  *        tag, ref: pointer to item to read
  414.  *        ptr: space to read item into
  415.  * Returns: 0 on success, -1 on failure with DFerror set
  416.  * Users:   HDF Fortran programmers
  417.  * Invokes: DFgetelement
  418.  *---------------------------------------------------------------------------*/
  419.  
  420.     FRETVAL(intf)
  421. #ifdef PROTOTYPE
  422. ndfget(intf *dfile, intf *tag, intf *ref, _fcd ptr)
  423. #else
  424. ndfget(dfile, tag, ref, ptr)
  425.     intf *dfile;
  426.     intf *tag, *ref;
  427.     _fcd ptr;
  428. #endif /* PROTOTYPE */
  429. {
  430.     return (DFgetelement((DF *)*dfile, (uint16)*tag, (uint16)*ref,
  431.             (char *)_fcdtocp(ptr)));
  432. }
  433.  
  434.  
  435. /*-----------------------------------------------------------------------------
  436.  * Name:    dfput
  437.  * Purpose: Call DFput to write an element
  438.  * Inputs:  dfile: pointer to HDF file
  439.  *        tag, ref: attributes of item to write
  440.  *        ptr: item to write
  441.  *        len: size of item
  442.  * Returns: 0 on success, -1 on failure with DFerror set
  443.  * Users:   HDF Fortran programmers
  444.  * Invokes: DFputelement
  445.  *---------------------------------------------------------------------------*/
  446.  
  447.     FRETVAL(intf)
  448. #ifdef PROTOTYPE
  449. ndfput(intf *dfile, intf *tag, intf *ref, _fcd ptr, intf *len)
  450. #else
  451. ndfput(dfile, tag, ref, ptr, len)
  452.     intf *dfile;
  453.     intf *tag, *ref;
  454.     intf *len;
  455.     _fcd ptr;
  456. #endif /* PROTOTYPE */
  457. {
  458.     return (DFputelement((DF *)*dfile, (uint16)*tag, (uint16)*ref,
  459.         (char*)_fcdtocp(ptr), *len));
  460. }
  461.  
  462. /*-----------------------------------------------------------------------------
  463.  * Name:    dfsfind
  464.  * Purpose: Call DFsetfind to set up search
  465.  * Inputs:  dfile: pointer to HDF file
  466.  *        tag, ref: attributes of item to find
  467.  * Returns: 0 on success, -1 on failure with DFerror set
  468.  * Users:   HDF Fortran programmers
  469.  * Invokes: DFsetfind
  470.  *---------------------------------------------------------------------------*/
  471.  
  472.     FRETVAL(intf)
  473. #ifdef PROTOTYPE
  474. ndfsfind(intf *dfile, intf *tag, intf *ref)
  475. #else
  476. ndfsfind(dfile, tag, ref)
  477.     intf *dfile;
  478.     intf *tag, *ref;
  479. #endif /* PROTOTYPE */
  480. {
  481.     return (DFsetfind((DF *) *dfile, (uint16)*tag, (uint16)*ref));
  482. }
  483.  
  484.  
  485. /*-----------------------------------------------------------------------------
  486.  * Name:    dffind
  487.  * Purpose: Call DFfind to find next match
  488.  * Inputs:  dfile: pointer to HDF file
  489.  *        itag, iref: attributes of item found
  490.  *        len: size of item
  491.  * Returns: 0 on success, -1 on failure with DFerror set
  492.  * Users:   HDF Fortran programmers
  493.  * Invokes: DFfind
  494.  *---------------------------------------------------------------------------*/
  495.  
  496.     FRETVAL(intf)
  497. #ifdef PROTOTYPE
  498. ndffind(intf *dfile, intf *itag, intf *iref, intf *len)
  499. #else
  500. ndffind(dfile, itag, iref, len)
  501.     intf *dfile;
  502.     intf *itag, *iref;
  503.     intf *len;
  504. #endif /* PROTOTYPE */
  505. {
  506.     DFdesc *ptr1;
  507.     intf ret;
  508.  
  509.     ptr1 = HDgetspace((uint32)sizeof(DFdesc));
  510.     ret = DFfind((DF *) *dfile, ptr1);
  511.  
  512.     *itag  = (int32)(ptr1->tag);
  513.     *iref = (int32)(ptr1->ref);
  514.     *len = ptr1->length;
  515.  
  516.     HDfreespace(ptr1);
  517.  
  518.     return(ret);
  519. }
  520.  
  521.  
  522. /*-----------------------------------------------------------------------------
  523.  * Name:    dferrno
  524.  * Purpose: Call DFerrno to get value of DFerror
  525.  * Inputs:  none
  526.  * Returns: value of DFerror
  527.  * Users:   HDF Fortran programmers
  528.  * Invokes: DFerrno
  529.  *---------------------------------------------------------------------------*/
  530.  
  531.     FRETVAL(intf)
  532. #ifdef PROTOTYPE
  533. ndferrno(void)
  534. #else
  535. ndferrno()
  536. #endif /* PROTOTYPE */
  537. {
  538.     return(DFerrno());
  539. }
  540.  
  541. /*-----------------------------------------------------------------------------
  542.  * Name:    dfnewref
  543.  * Purpose: Call DFnewref to get unused ref no
  544.  * Inputs:  dfile: pointer to HDF file
  545.  * Returns: int16: unused ref no
  546.  * Users:   HDF Fortran programmers
  547.  * Invokes: DFnewref
  548.  *---------------------------------------------------------------------------*/
  549.  
  550.     FRETVAL(intf)
  551. #ifdef PROTOTYPE
  552. ndfnewref(intf *dfile)
  553. #else
  554. ndfnewref(dfile)
  555. intf *dfile;
  556. #endif /* PROTOTYPE */
  557. {
  558.     return(DFnewref((DF *) *dfile));
  559. }
  560.  
  561.  
  562. /*-----------------------------------------------------------------------------
  563.  * Name:    dfnumber
  564.  * Purpose: Call DFnumber to get unused ref no
  565.  * Inputs:  dfile: pointer to HDF file
  566.  *        tag:   pointer to (int16)tag to count
  567.  * Returns: int: number of occurances of given tag
  568.  * Users:   HDF Fortran programmers
  569.  * Invokes: DFnumber
  570.  *---------------------------------------------------------------------------*/
  571.  
  572.     FRETVAL(intf)
  573. #ifdef PROTOTYPE
  574. ndfnumber(intf *dfile, intf *tag)
  575. #else
  576. ndfnumber(dfile, tag)
  577. intf *dfile;
  578. intf *tag;
  579. #endif /* PROTOTYPE */
  580. {
  581.     return(DFnumber((DF *) *dfile, (uint16)*tag));
  582. }
  583.  
  584.  
  585. /*-----------------------------------------------------------------------------
  586.  * Name:    dfstat
  587.  * Purpose: Call DFstat to get staus info on file
  588.  * Inputs:  dfile:  pointer to HDF file
  589.  *        dfinfo: pointer to DFdata structure to fill in
  590.  * Returns: 0 on success, -1 on failure with DFerror set
  591.  * Users:   HDF Fortran programmers
  592.  * Invokes: DFstat
  593.  *---------------------------------------------------------------------------*/
  594.  
  595.     FRETVAL(intf)
  596. #ifdef PROTOTYPE
  597. ndfstat(intf *dfile, DFdata *dfinfo)
  598. #else
  599. ndfstat(dfile, dfinfo)
  600. intf *dfile;
  601. DFdata *dfinfo;
  602. #endif /* PROTOTYPE */
  603. {
  604.     return(DFstat((DF *) *dfile, dfinfo));
  605. }
  606.  
  607.  
  608. /*-----------------------------------------------------------------------------
  609.  * Name:    dfiishdf
  610.  * Purpose: Call DFishdf to test file
  611.  * Inputs:  name:    name of file to test
  612.  *        namelen: pointer to variable containing length of name string
  613.  * Returns: 0 on success, -1 on failure with DFerror set
  614.  * Users:   HDF Fortran programmers
  615.  * Invokes: DFishdf
  616.  *---------------------------------------------------------------------------*/
  617.  
  618.     FRETVAL(intf)
  619. #ifdef PROTOTYPE
  620. ndfiishdf(_fcd name, intf *namelen)
  621. #else
  622. ndfiishdf(name, namelen)
  623.     _fcd name;
  624.     intf *namelen;
  625. #endif /* PROTOTYPE */
  626. {
  627.     char *fn;
  628.     intf ret;
  629.  
  630.     fn = DFIf2cstring(name, *namelen);
  631.     ret = DFishdf(fn);
  632.     HDfreespace(fn);
  633.     return(ret);
  634. }
  635.  
  636.